//
//  MBProgressHUD+Toast.m
//  HWZB
//
//  Created by 许成雄 on 2017/4/29.
//  Copyright © 2017年 wonders. All rights reserved.
//

#import "MBProgressHUD+Toast.h"


@implementation MBProgressHUD (Toast)

+ (void)showToast:(NSString *)message initWithView:(UIView *)view {
    MBProgressHUD *HUD = [[MBProgressHUD alloc] initWithView:view];
    [view addSubview:HUD];
    HUD.labelText = message;
    HUD.mode = MBProgressHUDModeText;
    HUD.color = [UIColor darkGrayColor];
    HUD.xOffset = 0.0f;
    HUD.yOffset = TRANS_VALUE(200.0f);
    HUD.margin = 10.0f;
    [HUD showAnimated:YES whileExecutingBlock:^{
        sleep(2);
    } completionBlock:^{
        [HUD removeFromSuperview];
    }];
}

@end
